An embodiment of the invention is related to digital image processing and the use of a render cache as a buffer when writing image data to main memory. Other embodiments are also described.
In digital image processing, natural scenes and artificially created ones (such as those created by computer graphics systems) are represented by digital images. An image includes a collection of picture elements (pixels) each of which is a set of numbers that may represent the intensity and/or color of a particular location on a display screen. For example, in the so called YUV color space, each pixel is defined as a combination having a Y component representing luminance, and a pair of U and V components representing color. A typical digital image may have upwards of one million pixels. To display an image, each pixel is translated into control signals that are then applied to activate a corresponding location of a display screen. In the case of video, a sequence of images or frames are rapidly processed and displayed sequentially at a high enough rate (e.g., greater than 20 frames per second) to show motion in the scene.
Current applications of digital image processing place a heavy demand on the constituent hardware and software. This is in part due to the large amount of image data called for by higher resolution images, and due to the complex digital processing algorithms that are applied to them. For example, in the case of a digital video disc (DVD) movie, a video stream has been compressed into a relatively small file that is stored on the disc. To play back the movie, a DVD player or desktop computer decodes this compressed file, to reconstruct the video stream. To avoid skipped frames in the playback, which lead to undesirable visual artifacts, the reconstructed video images should be generated within predetermined time intervals so that the video images are ready in time to be applied to the display screen. This places an even greater demand on the hardware and software, particularly at higher frame rates or image resolutions.
A typical hardware/software platform for digital image processing may be a personal computer, or other electronic system, that has the following primary hardware components: a central processing unit (CPU) or host processor, such as a PENTIUM processor by Intel Corp., Santa Clara, Calif.; a graphics controller, such as one that is integrated within and is a display adapter component of a system chipset (e.g., the 865G chipset by Intel Corp.); and main memory (also referred to as system memory) composed of for example dynamic random access memory (DRAM). The graphics controller is a specialized integrated circuit that performs various types of compute-intensive digital image processing upon image data.
The software may be loaded into main memory once the system has been booted, to be executed by the host processor. This software may include an application program such as DVD player software, an operating system program, and a device driver that is used by the application program for accessing hardware registers of the graphics controller. Once the hardware has been configured by the operating system and driver, the application program can execute.
When executing DVD player software, for example, part or all of a compressed movie file (e.g., in motion picture experts group, MPEG, format) is first loaded into main memory. The software and the compressed movie file provide instructions to the host processor and the graphics controller (translated by the device driver and operating system) for decoding the movie file. Much of the decoding task is typically performed by a specialized hardware video engine in the graphics controller, for greater speed of execution. The video engine generates the reconstructed frame or image in chunks, where each chunk is known as a pixel macroblock (or simply pixel block). An example of a pixel block is a square of 16×16 contiguous pixels. The stream of pixel blocks is written to main memory where it is stored, pending further processing by a display engine in the graphics controller. The display engine may perform further digital image processing such as color shading of the pixel blocks. The pixel blocks are then eventually translated into control signals that are then applied to activate corresponding locations of a display screen.
As mentioned above, the processing and display of video is time sensitive, i.e. has real-time requirements such as a minimum frame rate. For example, a popular video requirement is 60 frames per second, such that there is about 16 milliseconds to complete the definition of the pixel blocks of each frame before the frame is applied to the display screen. To help meet such requirements, it is considered good practice to avoid stalling the video engine so that there is a steady flow of pixel blocks at its output. A fast but small storage device known as a render cache is used for buffering the output of the video engine.
The render cache is typically integrated within the graphics controller, and is used by other image processing tasks (such as rendering 2D and 3D graphics) as a buffer for temporary storage of a small amount of recently accessed image data that is being processed by the graphics controller. To give an idea of the relative storage size at issue here, a typical render cache can store 8 kilobytes (KB) whereas each frame is typically more than 1 megabyte (MB), and main memory has hundreds of megabytes of storage. The render cache is situated in a data path between the video engine and the main memory, and can thus be used as a buffer through which the pixel blocks decoded by the video engine are written to memory.
The organization of image data as it is stored in main memory, to be used by the display engine, is typically dictated by the operating system. In practice, an application program requests the operating system to allocate a certain amount storage space to it, for storing the pixel blocks that will be displayed. The operating system responds by returning a set of addresses that point to the allocated space. These addresses are then used to instruct the graphics controller where to transfer the pixel blocks from the render cache.